<template>
	<view class="video" v-if="list && list.length">
		<view class="content">
			<view class="title">
				{{list[index].bannerName}}
			</view>
			<swiper class="swiper" indicator-dots @change="handleChange">
				<swiper-item v-for="(item) in list" :key="item.id">
					<view class="item">
						<j-video height="388rpx" width="686rpx" :poster="item.pageImg" :url="item.viedoUrl"></j-video>
					</view>
					<!-- 			<n-video 
					:id="10001" 
					height="388rpx" 
					width="100vw"
					src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4">
					
					</n-video> -->

				</swiper-item>
			</swiper>


		</view>
	</view>
</template>

<script>
	import NVideo from '@/components/video/index.vue'
	export default {
		components: {
			NVideo
		},
		props: {
			list: {
				type: Array,
				default: () => []
			},
		},
		data() {
			return {
				index: 0
			};
		},
		methods: {
			handleChange(event) {
				this.index = event.detail.current;
			}
		},
		created() {
			console.log(this)
		},

	}
</script>

<style lang="scss" scoped>
	.video {
		position: relative;
		padding: 20rpx;
		padding-top: 0;

		.content {
			width: 100%;
			padding: 15rpx;
			padding-top: 30rpx;
			// padding-bottom: 41rpx;
			background: #fff;
			box-shadow: 0px 3px 10px 0px rgba(216, 216, 216, 0.49);
			border-radius: 10rpx;

			.title {
				width: 100%;
				padding-left: 5rpx;
				font-size: 30rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: bolder;
				color: #333333;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				overflow: hidden;
				// text-overflow: ellipsis;
				-webkit-line-clamp: 2;
				margin-bottom: 20rpx;
			}

			.swiper {
				width: 100%;
				height: 408rpx;

				// height: 388rpx;
				.item {
					height: 408rpx;
				}

				.myVideo {
					width: 100%;
					height: 388rpx;
					margin-top: 20rpx;
					display: flex;
					border-radius: 8rpx;
				}

				/deep/.uni-swiper-dots-horizontal {
					bottom: 0;
				}

				/deep/.uni-swiper-dot-active {
					background-color: #EB4D3C;
				}

				/deep/.uni-swiper-dot {
					width: 10rpx;
					height: 10rpx;
				}
			}

		}

		/deep/.uni-video-cover-duration {
			display: none;
		}
	}
</style>
